<div class="row">
                        <div class="col-sm-12">
                             <div class="box">
                                <div class="box-header with-border">

                                    <div class="pull-right">
                                    <?php echo anchor('backend/sfexpress', '<i class="fa fa-plus"></i> 在线下单', array('class' => 'btn btn-block btn-sm btn-primary btn-flat')); ?>
                                    </div>
                                    
                                    <div class=" col-sm-6">
                                    <?php echo form_open(current_url(), array('class' => 'form-inline', 'method'=>'get', 'id' => 'search_goods')); ?>                                    
                                    
                                    <div class="form-group" style="margin-right:15px;">
                                    <label> <?php echo form_input($keyword);?></label>
                                    </div>
                                    <?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-sm btn-primary btn-flat', 'content' => "搜索订单")); ?>
                                    
                                    
                                    <?php echo form_close();?>
                                    </div>

                                     <div class=" col-sm-2" style="line-height:30px;font-size:12px;">
                                        <?php echo '共'.$total.'条记录，'.$page.'/'.$pages.'页';?>
                                    </div>
                                </div>
                                <div class="box-body" style="margin-top:20px;">
                                   
                                  
<?php foreach ($data as $item):?>
<div class="row" style="color:#555;line-height:35px;border-bottom:1px solid #e1e1e1;padding:15px 0;">
    <span class="col-sm-2"><span class="label label-info">收件人</span> <?php echo $item["reciver"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">联系方式</span> <?php echo $item["re_mobile"].'/'.$item["re_phone"]; ?></span>
    <span class="col-sm-4"><span class="label label-info">收件地址</span> <?php echo $item["re_country"]; ?>,<?php echo $item["re_state"]; ?>,<?php echo $item["re_city"]; ?>,<?php echo $item["re_address"]; ?>,<?php echo $item["re_postcode"]; ?> </span>
    <span class="col-sm-2"><span class="label label-info">订单号</span> <a href="/backend/orders?keyword=<?php echo $item["ordersn"]; ?>" target="_blank"><?php echo $item["ordersn"]; ?></a></span>    
    <span class="col-sm-2"><span class="label label-info">下单时间</span> <?php echo $item["addtime"]; ?></span> 

    <span class="col-sm-2"><span class="label label-info">寄件人</span> <?php echo $item["se_company"].' : '.$item["sender"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">联系方式</span> <?php echo $item["se_mobile"]; ?></span>
    <span class="col-sm-4"><span class="label label-info">寄件地址</span> <?php echo $item["se_state"]; ?>,<?php echo $item["se_city"]; ?>,<?php echo $item["se_address"]; ?>,<?php echo $item["se_postcode"]; ?> </span>
    <span class="col-sm-2"><span class="label label-info">快递号</span>&nbsp<a href='https://www.sf-express.com/us/en/dynamic_function/waybill/#search/bill-number/<?php echo $item["sfordersn"];?>' target="_blank"><?php echo $item["sfordersn"]?$item["sfordersn"]:"待预约"; ?></a></span>    
    <span class="col-sm-2"><span class="label label-info">快递单</span>&nbsp<a href="<?php echo $item["pdfurl"]?$item["pdfurl"]:"/backend/sfexpress/pdf/".$item["id"]; ?>" target="_blank">PDF</a></span> 

    <span class="col-sm-2"><span class="label label-info">申报中文</span> <?php echo $item["cnname"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">申报英文</span> <?php echo $item["enname"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">申报数量</span> <?php echo $item["number"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">申报金额</span> $<?php echo $item["price"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">申报总价</span> $<?php echo $item["total"]; ?></span>
    <span class="col-sm-2"><span class="label label-info">重量</span> <?php echo $item["weight"]; ?>kg</span>
    <?php
    if($item["remark"]):
    ?>
    <span class="col-sm-4"><span class="label label-info">备注</span> <span class="text-danger"><?php echo $item["remark"]; ?></span></span>
    <?php endif;
    if($item["method"]=="F2" && empty($item["sfordersn"])):
    ?>
    <span class="col-sm-2"><button class="cancelcd btn btn-flat btn-danger btn-sm" rid="<?php echo $item["id"];?>"> 取消CD预约 </button></span>
    <?php endif;?>
</div>
<?php endforeach;?>
                                     
                                    <?php 
                                    if(empty($data)){
                                        echo "<h2 style='text-align:center;padding:50px 0;'>没有查询到数据</h2>";
                                    }
                                    ?>
                                    <?php echo $pager;?>
                                </div>
                            </div>
                         </div>
                    </div>

<script>
$(".cancelcd").on("click",function(){
    var cid=$(this).attr("rid");
    var row=$(this).parent().parent();
    layer.confirm("确认要取消吗，取消将无法恢复？", { title: "确认" }, function (index) {           
        $.ajax({
            type:"post",
            url:"/backend/sfexpress/ajaxdel",
            dataType:"json",
            data:{"cid":cid},
            error:function(){
            },
            success:function(result){
                if(result["status"]==1)
                {
                    row.remove();
                }
                else
                {
                    layer.msg(result["msg"]);
                }
            },
        });
        layer.close(index); 
    });
});
</script>
